<template>
    <div class="courses-nav">
        <el-menu :default-active="activeIndex" class="el-menu-demo"  mode="horizontal" :router="true">
            <el-menu-item index="/Admin/VirtualManage/VirtualSelectManage/VirtualSelect">虚机管理</el-menu-item>
            <el-menu-item index="/Admin/VirtualManage/MirrorManage/MirrorSelect">镜像管理</el-menu-item>
            <el-menu-item index="/Admin/VirtualManage/TrainingEnvironment">实训环境</el-menu-item>
        </el-menu>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                activeIndex: ''
            }
        },
        created() {
            let self = this
            self.fetchDate()
        },
        methods: {
            fetchDate() {
                let self = this
                var cur_path = self.$route.meta.navActive; //获取当前路由
                self.activeIndex = cur_path
            },
            handleSelect(key, keyPath) {
                console.log(key, keyPath)
            }
        },
        watch: {
            "$route": "fetchDate"
		}
    }
</script>
<style scoped  lang="scss">
    .el-menu-demo{
        .el-menu-item{
            &:hover{
                    color:#1277eb
            }
        }
    }

</style>
